package transport

import (
	"mcode/apps/admin/internal/endpoint"
	"mcode/apps/admin/internal/middleware"
	"time"

	"github.com/gin-gonic/gin"
)

func RegisterApiHttp(router *gin.RouterGroup, handlers *endpoint.Handlers) {
	router.POST("/register", handlers.UserHandler.Register)
	router.POST("/login", handlers.UserHandler.Login)
	router.POST("/refresh-token", middleware.Jwt(), middleware.RateLimit(3, time.Minute), handlers.UserHandler.RefreshToken)
	router.GET("/users", middleware.Pagination(), handlers.UserHandler.List)
	router.GET("/test", middleware.Jwt(), middleware.Pagination(), handlers.UserHandler.TestUser)
	router.GET("/users/me", middleware.Jwt(), handlers.UserHandler.GetProfile)
}
